<?php /* Smarty version Smarty-3.1.18, created on 2017-06-02 14:57:35
         compiled from "/data/www/mystery/protected/modules/webadmin/views/question/set_common.tpl" */ ?>
<?php /*%%SmartyHeaderCode:66977065354bfaf357220d6-51702337%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '474f06071c8441b6b2d8457b1ebd4ca04ec977fa' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/question/set_common.tpl',
      1 => 1494904925,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '66977065354bfaf357220d6-51702337',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54bfaf357569b6_61815762',
  'variables' => 
  array (
    'subjects' => 0,
    'ls' => 0,
    'questionType' => 0,
    'page' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54bfaf357569b6_61815762')) {function content_54bfaf357569b6_61815762($_smarty_tpl) {?><div class="pad_10">
	<div class="table-list">
		<table width="100%">
			<thead>
				<tr>
					<th width="79">序号</th>
					<th width="136">题目编号</th>
					<th width="315">题目名称</th>
					<th width="148">是否基本信息</th>
					<th width="127">题目类型</th>
					<th width="276">管理操作</th>
				</tr>
			</thead>
			<tbody>
				<?php  $_smarty_tpl->tpl_vars['ls'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['ls']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['subjects']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['ls']->key => $_smarty_tpl->tpl_vars['ls']->value) {
$_smarty_tpl->tpl_vars['ls']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['ls']->key;
?>
				<tr onMouseOver="this.className = 'tr2'" onMouseOut="this.className = 'tr1'" class="tr1">
					<td align="center"><?php echo $_smarty_tpl->tpl_vars['ls']->value['subject_id'];?>
</td>
					<td align="center"><a href="javascript:void(0);"></a> <?php echo $_smarty_tpl->tpl_vars['ls']->value['question_num'];?>
 </td>
					<td align="center"><a href="javascript:void(0);"><?php echo $_smarty_tpl->tpl_vars['ls']->value['title'];?>
</a></td>
					<td align="center">
						<?php if ($_smarty_tpl->tpl_vars['ls']->value['is_basic']) {?>
							是
						<?php } else { ?>
							否
						<?php }?>
					</td>
					<td align="center"><?php echo $_smarty_tpl->tpl_vars['questionType']->value[$_smarty_tpl->tpl_vars['ls']->value['question_type']]['title'];?>
</td>
					<td align="center"><a name="delete" rel="<?php echo $_smarty_tpl->tpl_vars['ls']->value['subject_id'];?>
" href="javascript:void(0);">删除</a> | <a href="/webadmin/question/subjectedit?tid=<?php echo $_smarty_tpl->tpl_vars['ls']->value['question_type'];?>
&qid=<?php echo $_smarty_tpl->tpl_vars['ls']->value['question_id'];?>
&sid=<?php echo $_smarty_tpl->tpl_vars['ls']->value['subject_id'];?>
">编辑</a></td>
				</tr>
				<?php } ?>
			</tbody>
		</table>
		<div style="float:right;"><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</div>
	</div>
</div>
	
<script type="text/javascript">
	$(function(){
		$('a[name="delete"]').click(function(){
			var subject_id = $(this).attr('rel');
			if(!parseInt(subject_id)){
				alert('请选择要删除的记录');
				return false;
			}
			var or = confirm('确定要删除吗？');
			if(or){
				$.ajax({
					type: "POST",
					async: true,
					url: '/webadmin/question/subjectdelete',
					data: {subject_id:subject_id},
					dataType: 'json',
					success: function (data) {
						alert(data.msg);
						if(data.ok){
							window.location.reload();
						}
					}
				});
			}
		});
		
	});
</script><?php }} ?>
